$(function () {

    $.messager.model = {
        ok:{ text: "确定", classed: 'btn-primary' },
        cancel: { text: "取消", classed: 'btn­danger' }
    };

    //删除操作
    $(".btn-delete").click(function () {
        var id = $(this).data('id');
        var url = $(this).data('url');
        var list = $(this).data('list');

        console.log(id);
        $.messager.confirm("温馨提示", "确定需要删除么?", function() {
            $.post(url,{id:id},function (data) {
                $.messager.confirm("温馨提示",data.msg, function () {
                    if(data.success){
                        location.href = list;
                    }
                });
            })
        });
    });
})